package be.music.tool.comparator;

import java.util.Comparator;

import be.music.tool.alert.Alert;
import be.music.tool.time.Time;

public class AlertComparator implements Comparator<Alert> {

	@Override
	public int compare(Alert o1, Alert o2) {
		
		Time time1 = o1.getTime();
		Time time2 = o2.getTime();
		
		int result = 0;
		
		if(time1.isBefore(time2)) {
			result = -1;
		}else if(time1.isAfter(time2)) {
			result = 1;
		}
		
		return result;
		
	}
	
}
